export default function createRoute (record, path) {
  // 创建路由信息对象 { matched, path }
  const matched = []

  // /music/pop
  // /music  需要存放两个组件
  while (record) {
    // 从首部推入  先进后出
    matched.unshift(record)
    record = record.parentRecord
  }

  return {
    matched,
    path
  }
}
